package com.tsing.tsingfengmall.file.service;

import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * @author TheTsing
 */
public interface IFileService {

    String upload(MultipartFile file);

    List<String> uploads(MultipartFile[] files);

    Map<String, String> policy(String name, Integer maxFileSize, Integer expire);

    String access(String url, Boolean download, Integer expire);

    ResponseEntity<Resource> download(String url);

    void delete(String url);

    void deletes(List<String> urls);

    Map<String, Object> partInit(String name, Long size, Integer partSize);

    String partMerge(String uploadId);

    void partAbort(String uploadId);

    List<Integer> partUploaded(String uploadId);

}
